Add triggering_user_name to DagRunProtocol interface#56193
Add triggering_user_name to DagRunProtocol interface#56193kaxil merged 6 commits intoapache:mainfrom
Conversation
Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface.
|
cc: @jscheffl |
jscheffl
left a comment
There was a problem hiding this comment.
Looks reasonable for me.
|
Cc: @kaxil I would like this in 3.1.1 |
|
Adding backport label but leave the decision to @kaxil if OK to backport as not a classic bug fix but a minor feature |
https://github.com/apache/airflow/blob/main/contributing-docs/19_execution_api_versioning.rst -- We would need to add a Cadwyn migration. Check examples in https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/api_fastapi/execution_api/versions |
Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers.
|
cc: @kaxil this looks good? |
airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py
Show resolved
Hide resolved
kaxil
left a comment
There was a problem hiding this comment.
1 test suggestion otherwise lgtm
) * Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set (cherry picked from commit 3120146) Co-authored-by: Dheeraj Turaga <dheerajturaga@gmail.com>
…che#56193) * Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set (cherry picked from commit 3120146) Co-authored-by: Dheeraj Turaga <dheerajturaga@gmail.com>
* Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set
* Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set
* Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set
* Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set
|
@kaxil , the milestone needs to be 3.1.1? This seems to be missing from 3.1.1rc1 |
* Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set
|
Didn't include it in 3.1.1 since it isn't a bugfix |
Can we include it? I remember you mentioned it shouldn't be a problem. especially now since we have cadwyn migration added aswell. Its a significant item for our workflows given there's no way in airflow3 to identify dagrun owner in the task |
I did but unfortunately couldn't justify it as a bugfix when cherry-picking so had changed the milestone attached to it. I really do not want to risk 3.1.1 since there were a couple of high-priority bugfixes in it. |
|
Ok looking back and tracking it -- We will have it in 3.1.2 |
* Add triggering_user_name to DagRunProtocol interface Enable tasks running in isolated environments to access the username that triggered a DAG run without requiring direct database access. Changes: - Add triggering_user_name field to DagRunProtocol interface - Update task-sdk DagRun data model to include triggering_user_name - Update execution API DagRun model to include triggering_user_name - Ensure field flows from database through API to task context This allows developers to identify DAG run triggers from within task code using the existing DagRunProtocol interface. * Fix tests! * Add Cadwyn migration for triggering_user_name field in DagRunProtocol Add backward compatibility migration for the new triggering_user_name field added to the DagRun model in the Execution API. This ensures older API clients continue to work seamlessly with newer API servers. * Add tests for older versions where triggering user is missing * Remove triggering user from v2025-04-28 * Add a test with triggering_user_name set (cherry picked from commit 3120146)
|
Has been cherry-picked as faeb1bf |
Enable tasks running in isolated environments to access the username
that triggered a DAG run without requiring direct database access.
Changes:
This allows developers to identify DAG run triggers from within task
code using the existing DagRunProtocol interface.